package com.tencent.sr.iris.activity.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 *
 */
@AllArgsConstructor
@Getter
public enum ActivityTaskStatusEnum {
    NORMAL((byte) 0, "正常"),
    EXPIRED((byte) 1, "失效"),
    DELETED((byte) 2, "删除"),
    ;

    private final byte code;
    private final String desc;

    public static ActivityTaskStatusEnum getByCode(byte code) {
        for (ActivityTaskStatusEnum staff : ActivityTaskStatusEnum.values()) {
            if (staff.getCode() == code) {
                return staff;
            }
        }
        return null;
    }
}
